package http

import (
	"bytes"
	"encoding/json"
	"net/http"
)

const rootUrl = "http://127.0.0.1:10001"

func UserBind(token string, key string) {
	//提交网络请求绑定用户
	jsonStr, _ := json.Marshal(map[string]interface{}{"token": token, "key": key})
	content := bytes.NewBuffer(jsonStr)
	http.Post(rootUrl+"/ws/server/bind_user", "application/json", content)
}

func UserHeartBeat(token string, key string) {
	//提交网络请求绑定用户
	jsonStr, _ := json.Marshal(map[string]interface{}{"token": token, "key": key})
	content := bytes.NewBuffer(jsonStr)
	http.Post(rootUrl+"/ws/server/user_heart_beat", "application/json", content)
}
